import {createRouter, createWebHistory} from 'vue-router'
import index from '../views/index.vue'
import main from '../views/Main.vue' //维修用户主页面
import NoticeList from '@/views/NoticeList.vue' //用户公告列表
import NoticeDetail from '@/views/NoticeDetail.vue' //用户公告详情
import NoticeAdmin from '@/views/NoticeAdmin.vue' //公告管理
import NewRepair from '@/views/NewRepair.vue' //新建报修
import RepairListAdmin from '@/views/RepairListAdmin.vue' //维修管理
import RepairListUser from '@/views/RepairListUser.vue' //用户报修列表
import RepairListWorker from '@/views/RepairListWorker.vue' //维修人员维修列表
import RepairInfo from '@/views/RepairInfo.vue' //报修详情
import HousingMaterial from '@/views/HousingMaterial.vue' //材料管理
import RepairAreaCode from '@/views/RepairAreaCode.vue'  //区域管理
import RepairCategory from '@/views/RepairCategory.vue' //维修类型管理
import RepairWorker from '@/views/RepairWorker.vue'  //维修人员管理
import AnotherPage from '@/views/AnotherPage.vue' //完成维修界面
import UserLogin from '@/components/UserLogin.vue';
import AdminLogin from '@/components/AdminLogin.vue';
import Jump from '@/components/Jump.vue';
import SuperAdminMain from '@/components/SuperAdminMain.vue';
import RePassword from '@/components/RePassword.vue';
import RepairAdminInfo  from "@/views/RepairAdminInfo.vue";  //维修详情管理员
import NoticeAdminDetail from "@/views/NoticeAdminDetail.vue"; //公告详情管理员
import AdminMain from "@/views/AdminMain.vue"; // 管理员主页面
import MealsMain from '@/components/meals/view/MealsMain.vue'
import StoreInfo from '@/components/meals/view/StoreInfo'
import UpdatePwd from '@/components/meals/view/UpdatePwd'
import home from '@/components/meals/view/home' // 膳食首页
import basicinfo from '@/components/meals/view/basicinfo.vue' //膳食模块，餐品的基本信息
import updateInfo from '@/components/meals/view/updateInfo.vue' // 更新商品状态
import TypeInfo from '@/components/meals/view/TypeInfo.vue' // 餐品类型信息
import TypeInsert from '@/components/meals/view/TypeInsert.vue' // 餐品类型新增
import OrderInfo from '@/components/meals/view/OrderInfo.vue' // 订单信息
import Refund from '@/components/meals/view/Refund' // 退款，取消订单
import Comment from '@/components/meals/view/Comment' // 评论
import ApplyStore from "@/components/meals/view/ApplyStore.vue"; // 申请店铺
import ProductInfo from "@/components/meals/view/ProductInfo.vue"; // 商品
import InsertProduct from '@/components/meals/view/InsertProduct.vue'; // 商品新增
import insert from '@/components/insert.vue';
import Approval from '@/components/Approval.vue';

import IndividualCenter from "@/views/IndividualCenter.vue"; // 维修个人中心
const routes = [
    {
        path: '/',
        redirect: '/UserLogin'
    },
    {
        path: '/UserLogin',
        name: 'UserLogin',
        component: UserLogin,
    },
    {
        path: '/',
        redirect: '/UserLogin'
    },
    {
        path: '/UserLogin',
        name: 'UserLogin',
        component: UserLogin,
    },
    {
        path: '/AdminLogin',
        name: 'AdminLogin',
        component: AdminLogin,
    },
    {
        path: '/jump',
        name: 'Jump',
        component: Jump,
    },
    {
        path: "/ApplyStore",
        name: "ApplyStore",
        component: ApplyStore
    },
    {
        path: '/SuperAdminMain',
        name: 'SuperAdminMain',
        component: SuperAdminMain,
        children: [
            {
                path: '/RePassword',
                name: 'RePassword',
                component: RePassword,
            },
            {
                path: '/insert',
                name: 'insert',
                component: insert,
            },
            {
                path: '/Approval',
                name: 'Approval',
                component: Approval,

            }

      ]
  },
  {
    path: '/MealsMain',
    name: 'MealsMain',
    component: MealsMain,
    children: [
      {
        path: '/StoreInfo',
        name: 'StoreInfo',
        component: StoreInfo,
      },
      {
        path: '/UpdatePwd',
        name: 'UpdatePwd',
        component: UpdatePwd,
      },
      {
        path: '/home',
        name: 'home',
        component: home,
      },
      {
        path: '/basicinfo',
        name: 'basicinfo',
        component: basicinfo,
      },
      {
        path: '/updateInfo',
        name: 'updateInfo',
        component: updateInfo,
      },
      {
        path: '/TypeInfo',
        name: 'TypeInfo',
        component: TypeInfo,
      },
      {
        path: '/TypeInsert',
        name: 'TypeInsert',
        component: TypeInsert,
      },
      {
        path: '/OrderInfo',
        name: 'OrderInfo',
        component: OrderInfo,
      },
      {
        path: '/Refund',
        name: 'Refund',
        component: Refund,
      },
      {
        path: '/Comment',
        name: 'Comment',
        component: Comment,
      },
    {
        path: '/ProductInfo',
        name: 'ProductInfo',
        component: ProductInfo,
    },
    {
        path: '/InsertProduct',
        name: 'InsertProduct',
        component: InsertProduct,
    },
    ],
  },
    {
        path: '/index',
        name: 'index',
        component: index
    },
    {
        path: '/main',
        name: 'main',
        component: main,
        children: [
            {
                path: '/notice-list',
                name: 'Notice',
                component: NoticeList,
            },
            {
                path: '/notice-detail',
                name: 'NoticeDetail',
                component: NoticeDetail,
            },
            {
                path: '/new-repair',
                name: 'NewRepair',
                component: NewRepair,
            },
            {
                path: '/repair-list-user',
                name: 'RepairListUser',
                component: RepairListUser,
            },
            {
                path: '/repair-list-worker',
                name: 'RepairListWorker',
                component: RepairListWorker,
            },
            {
                path: '/repair-info/:id/:num',
                name: 'RepairInfo',
                component: RepairInfo,
                props: true,
            },
            {
                path: '/another-page/:id/:num',
                name: 'AnotherPage',
                component: AnotherPage,
            },{
            path: '/individual-center',
            name: 'IndividualCenter',
            component: IndividualCenter,
            }
        ],
    },
    {
        path: '/admin-main',
        name: 'AdminMain',
        component: AdminMain,
        children: [
            {
                path: '/notice-admin',
                name: 'NoticeAdmin',
                component: NoticeAdmin,
            },
            {
                path: '/repair-list-admin',
                name: 'RepairListAdmin',
                component: RepairListAdmin,
            },
            {
                path: '/housing-material',
                name: 'HousingMaterial',
                component: HousingMaterial,
            },
            {
                path: '/repair-area-code',
                name: 'RepairAreaCode',
                component: RepairAreaCode,
            },
            {
                path: '/repair-category',
                name: 'RepairCategory',
                component: RepairCategory,
            },
            {
                path: '/repair-worker',
                name: 'RepairWorker',
                component: RepairWorker,
            },
            {
                path: '/repair-admin-info/:id/:num',
                name: 'RepairAdminInfo',
                component: RepairAdminInfo,
                props: true,
            },{
                path: '/notice-admin-detail',
                name: 'NoticeAdminDetail',
                component: NoticeAdminDetail,
            }
        ]
    }
]
const router = createRouter({
    history: createWebHistory(process.env.BASE_URL),
    routes
})

export default router
